package com.example.wm.config;//package com.example.wm.config;
//
//import lombok.extern.slf4j.Slf4j;
//import org.apache.ibatis.annotations.Param;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
//@Configuration
//@Slf4j
//public class webconfig extends WebMvcConfigurationSupport {
//    @Override
//    //设置静态资源映射
//    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
//
//          registry.addResourceHandler("/tessdata/**").addResourceLocations("classPath:/tessdata/");
//                 log.info("开始静态资源映射");
//
//
//    }
//}

import com.example.wm.utils.ClientIpLoggingInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private ClientIpLoggingInterceptor clientIpLoggingInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(clientIpLoggingInterceptor);
    }
}
